﻿$(document).ready(function (){
	sessionUrl();
	showsession();
	checkmsg();
	checklinks();
	showtime = getNowFormatDate();
	var replyid = GetQueryString('replyid');
	$.ajax({
		type:'post',
		url:'../actions/c2cAction.php',
		data:	{
					act			:'showrelydetail',
					replyid		:replyid,
				}, 
		async: true,	
		beforeSend:function(){
			showMistAndWait();
		},
		success:function(data){
			//console.log(data);
			if(data){
				$('.replyDiv').html(data);
			}
			hideMistAndWait();
		}
	});
	
	$(document).on('click','.dialoglist',function(){
		console.log(2);
		var postid  = GetQueryString('postid');
		var userid1 = $(this).attr('userid1');
		var userid2 = $(this).attr('userid2');
		$.ajax({	//先根据postid读取Postdetail信息
			type:'post',
			url:'../actions/c2cAction.php',
			data:	{
				act		: 	'getdialoglist',
				postid  :	postid,
				userid1 :	userid1,
				userid2 :	userid2
			}, 
			async: true,
			beforeSend:function(){
				showMistAndWait();
			},
			success:function(data){
				//console.log(data);
				if(data){
					$('.dialoglistcontent').html(data);
					$('#dialoglistmodal').modal('show');
					$('#reply2sbModal').modal('hide');
				}
				hideMistAndWait();
			}
		}); 
	});
});



